package github.ziwukun.jsonql.lang;

import java.io.Serializable;

/**
 * JSONQL语句抽象接口
 * @author Hugo.Yu
 */
public interface JSONQL extends ToJSONQLable,Serializable{
	public static JSONQL readJson(String json) {
		return JSONQLJson.readJson(json);
	}
	
	public static JSONQLBuilder builder() {
		return new JSONQLBuilder();
	}
	
	Select select();
	String from();
	Where where();
	Limit limit();
	Sort sort();
	
	JSONQL repSelect(Select select);
	JSONQL repFrom(String from);
	JSONQL repWhere(Where where);
	JSONQL repLimit(Limit limit);
	JSONQL repSort(Sort sort);
	
	public static JSONQL newInstance(Select select,String from,Where where,Limit limit,Sort sort) {
		return new JSONQLImpl(select, from, where, limit, sort);
	}
	
	public static JSONQL newInstance(Select select,String from,Where where) {
		return new JSONQLImpl(select, from, where, null, null);
	}
}
